<li id="micropost-<%= micropost.id %>">

<% @microposts.each do |micropost| %>
  <tr>
    <td><%= micropost.task %></td>
    <td><%= micropost.cost %></td>
    <td><%= micropost.date %></td>

    <td><%= link_to 'Show', micropost %></td>
    <td><%= link_to 'Edit', edit_micropost_path(micropost) %></td>
    <td><%= link_to 'Destroy', micropost, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>


  <span class="user"><%= link_to micropost.user.name, micropost.user %></span>
  <span class="content"><%= micropost.task %></span>
  <span class="timestamp">
    Posted <%= time_ago_in_words(micropost.created_at) %> ago.
  </span>
</li>